/*****************************************************************************/
/*          Perot Systems Framework                                          */
/*****************************************************************************/

/******************************************************************************/
/* Step 0. Preparations/Declarations                                          */
/******************************************************************************/
SET NOCOUNT OFF

/******************************************************************************/
/* Step 1. Remove stored procedure if it already exists                       */
/******************************************************************************/
IF (SELECT OBJECT_ID('[Kernel].[AllMessages]')) IS NOT NULL 
BEGIN
  DROP PROCEDURE [Kernel].[AllMessages] 
END
GO

IF (SELECT OBJECT_ID('[DBO].[AllMessages]')) IS NOT NULL 
BEGIN
  DROP PROCEDURE [DBO].[AllMessages] 
END
GO

/*****************************************************************************/
/* Stored Procedure :: AllMessages                                           */
/*****************************************************************************/
/* Copyright (C) 2004, Perot Systems Corporation. All right reserved.        */
/* Developer: Randy Moos   (randy.moos@ps.net)                               */
/* Started:  03/04/2004                                                      */
/*****************************************************************************/
CREATE PROCEDURE [Kernel].[AllMessages] 
AS 
BEGIN
    SELECT 
        OID,
        Text,
        [timestamp]
    FROM 
        Messages   
END
GO

/******************************************************************************/
/* Step 3. Assign appropriate permissions                                     */
/******************************************************************************/
GRANT EXECUTE ON [Kernel].[AllMessages] TO [Liberty_Users]
GO
-- Developers and Admins have permissions to execute through membership   
   